As of Think C 4.0, there is a confirmed bug which causes problems when an instance variable is an array of pointers, and the elements of this array are allocated dynamically using new(). In the author's experience this problem arises when a non-constant is used to specify the element of the array being allocated.
To avoid this problem it is sufficient to use a temporary variable such that the dynamic allocation takes place separately from assigning the new pointer to the array element. The following example illustrates this technique. It is assumed that student_array[] is an instance variable of class Room.
int Room::init(void)
{ int i;
Student *temp_student;
for (i=0 ; i<MAX_STUDENTS ; i++)
{ temp_student = new(Student); /* use temp due to bug in Think C 4.0 */
student_array[i] = temp_student; /* now it's ok to assign the pointer */